﻿@model Tasks.UI.Models.Home.LoginModel
@{
    ViewBag.Title = "ChangePassword";
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>密码修改</title>
    <link href="@Config.GetCssResourcePath("main.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/global.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $().ready(function () {

            $("#form").validate({
                rules: {
                    OldPassword: {
                        required: true
                    },
                    NewPassword: {
                        required: true,
                        minlength: 5
                    },
                    ConfirmPassword: {
                        required: true,
                        minlength: 5,
                        equalTo: "#NewPassword"
                    }
                },
                messages: {
                    OldPassword: "请输入原密码",
                    NewPassword: {
                        required: "请输入新密码",
                        minlength: "长度小于5"
                    },
                    ConfirmPassword: {
                        required: "请输入确认密码",
                        minlength: "长度小于5",
                        equalTo: "密码不一样"
                    }

                }
                ,
                /* 错误信息的显示位置 */
                errorPlacement: function (error, element) {
                    error.appendTo(element.parent());
                },
                success: function (strong) {
                    $("#modelError").hide();
                    strong.html("<img src='../../Images/accept.png'/>");
                }

            });

        });
    </script>
</head>
<body>
    <form action="ChangePassword" method="post" id="form">
    <div id="container">
        <div class="navTitle">
            修改密码</div>
        <div id="horizontalsuccess">
            <div id="horizontal">
                <table>
                    <tr>
                        <td>
                            <strong>原密码：</strong>
                        </td>
                        <td>@Html.PasswordFor(t => t.OldPassword, new { style = "width:156px" })
                            <b style="color: Red; font-size: x-small" id="modelError">
                                @Model.error
                            </b>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <strong>新密码：</strong>
                        </td>
                        <td>@Html.PasswordFor(t => t.NewPassword, new { style = "width:156px" })
                            <b></b>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <strong>确认密码：</strong>
                        </td>
                        <td>@Html.PasswordFor(t => t.ConfirmPassword, new { style = "width:156px" })
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td align="center">
                            <div style="color: Red; font-size: x-small">
                                @Model.Correct
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <br />
                            &nbsp&nbsp&nbsp
                            <input class="large_button" type="submit" value="修改密码" style="width: 90px" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
